package com.vision.admin.company.cl.ui;

import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.vision.admin.cl.AdminServices;
import com.vision.admin.cl.AdminTasks;
import com.vision.core.cl.AppPlace;
import com.vision.core.cl.BaseModule;
import com.vision.core.cl.mvp.AbstractPresenter;
import com.vision.core.cm.db.data.Company;
import com.vision.core.cm.serv.rpc.AbstractServiceAsync;

/**
 * 
 * @author Mark
 *
 */
public class CompaniesPresenter extends AbstractPresenter<Company> {

	public CompaniesPresenter() {
		super(AdminServices.companySvc());
	}
	
	public CompaniesPresenter(AbstractServiceAsync<Company> service) {
		super(service);
	}
	
	@Override
	protected String getDisplayText(Company obj) {
		return obj.getName();
	}

	@Override
	public void onAddClicked(SelectEvent e) {
		BaseModule.visit(new AppPlace(AdminTasks.ADD_COMPANY));
	}
}
